<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<script type="text/javascript" src="js/dateTime.js"></script>

<script type="text/javascript"
	src="<%=path %>/My97DatePicker/WdatePicker.js"></script>

<title>添加工作包</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link href="/sbm/css/screen.css" rel="stylesheet" type="text/css">

<script language="javascript">
	function mycheck() {
		if (myform.title.value == "") {
			alert("工作包名称不能为空！");
			myform.title.focus();
			return false;
		}
		if (myform.description.value == "") {
			alert("工作包描述不能为空！");
			myform.description.focus();
			return false;
		}
		if (myform.name.value == -1) {
			alert("请选择工作负责人");
			myform.name.focus();
			return false;
		}
		if (myform.workamount.value == 0.0) {
			alert("请填写工作量");
			myform.workamount.focus();
			return false;
		}
		if (myform.progress.value > 100) {
			alert("工作进度不能大于100");
			myform.progress.focus();
			return false;
		}
		if (myform.startdate.value == "") {
			if (confirm("工作包起始时间未定？")) {
				return true;
			} else {
				return false;
			}
		}
		if (myform.deadline.value == "") {
			if (confirm("工作包结束时间未定？")) {
				return true;
			} else {
				return false;
			}
		}
	}
</script>
</head>


<body>
	<s:form action="addwork" method="post" enctype="multipart/form-data"
		name="myform">
		<table width="600px" align="center" class="class1">
			<tr>
				<td colspan="3" align="right"><span class="title">新增一个工作包</span>
				</td>
			</tr>
			<tr>
				<td width="10%">&nbsp;</td>
				<td>
					<table>
						<tr>
							<td width="30%" height="38" align="left">工作包名称</td>
							<td><s:textfield name="work.title" Id="title" />
							</td>
						<tr>
						<tr>

							<td align="left">&nbsp;&nbsp;&nbsp;工<br />&nbsp;&nbsp;&nbsp;作<br />&nbsp;&nbsp;&nbsp;包<br />&nbsp;&nbsp;&nbsp;描<br />&nbsp;&nbsp;&nbsp;述</td>
							<td><textarea name="work.description" rows="15"
									id="description"></textarea>
							</td>
						<tr>
						<tr>
							<td align="left">工作包类型</td>
							<td><select name="work.type" id="type">
									<option value="0">任务</option>
									<option value="1">改进</option>
									<option value="2">BUG</option>
									<option value="3">讨论</option>
									<option value="4">未定</option>
							</select></td>
						</tr>
						<tr>
							<td align="left">工作优先</td>
							<td><select name="work.priority">
									<option value="2">普通</option>
									<option value="0">紧急</option>
									<option value="1">优先</option>
									<option value="3">置后</option>
									<option value="4">延迟</option>
							</select></td>
						</tr>
						<tr>
							<td align="left">工作状态</td>
							<td><input type="radio" name="work.status" value="0">不活跃
								&nbsp;&nbsp;<input type="radio" name="work.status" value="1">活跃
							</td>
						</tr>
						<tr>
							<td align="left">工作进度</td>
							<td><s:textfield name="work.progress" id="progress" />%</td>
						</tr>
						<tr>
							<td align="left">工作起始时间</td>
							<td><s:textfield name="work.startdate"
									onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" id="startdate" />
							</td>
						</tr>
						<tr>
							<td align="left">工作结束时间</td>
							<td><s:textfield name="work.deadline"
									onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" id="deadline" />
							</td>
						</tr>
						<tr>
							<td align="left">上传文件</td>
							<td><s:file name="image" label="请选择文件"></s:file></td>
						</tr>
						<tr>
							<td align="left">工作负责人</td>
							<td><s:select list="userlist" listValue="name"
									headerValue="请选择" headerKey="-1" listKey="userid" value="name"
									name="userid" id="name"></s:select>
							<td>
						</tr>
						<tr>
							<td align="left">工作量</td>
							<td><s:textfield name="work.workamount" id="workamount"
									value="0.0" />人·天</td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td>&nbsp;&nbsp;&nbsp;&nbsp;<input name="Submit"
								type="submit" value="确 认" onClick="return mycheck();" />
							</td>
						</tr>
						<tr>
							<td colspan="2" align="right"><a href="showallwork">返回查看所有工作包</a>
							</td>
						</tr>
						<tr>
							<td height="35" colspan="2" class="top_hui_text" align="center"
								colspan="2"><span class="errorAndmes"><s:actionerror
										cssStyle="font-family: Arial,Helvetica,sans-serif" /> </span>
							</td>
						</tr>
					</table></td>
				<td width="20%">&nbsp;</td>
			</tr>

		</table>
	</s:form>
</body>